import React, { Component } from 'react';
import { Row, Col, Button } from 'antd';
import { Relax } from 'iflux2';
import { Map } from 'immutable';

import moment from 'moment';


@Relax
export default class OrderInfo extends Component {
    static defaultProps = {
        order: Map()
    };

    constructor(props) {
        super(props);
        this.state = {}
    }

    render() {
        const { order } = this.props;

        return <div className="order-info">
            <Row>
                <Col span={16}>
                    <div>
                        <b className="font-14">订单编号：</b>
                        <span className="t-grayer">{order.get('tid')}</span>
                        <span className="t-grayer pushl">下单时间：{moment(order.get('ctime')).format('YYYY-MM-DD HH:mm:ss')}</span>
                        <b className="font-14 ml30">订单状态：</b>
                        <span className="t-red">已完成</span>
                    </div>
                    <div className="info-items pusht">
                        <Row>
                            <Col span={8}>
                                <span>订单总额：</span>
                                <span className="t-red">&yen;{(order.get('totalTradeCash') || 0).toFixed(2)}</span>
                            </Col>
                            <Col span={16}>
                                <span>支付方式：</span>
                                <span>{order.get('payTypeName')}</span>
                            </Col>

                        </Row>
                    </div>
                </Col>
                <Col span={8}>
                    <div className="buyer t-right">
                        <div className="avatar"></div>
                        <span className="va-m pushl">买家：{order.get('buyNickName')}</span>
                        <span className="va-m ml30">会员编号：{order.get('buyUsercode')}</span>
                    </div>
                </Col>
            </Row>
        </div>
    }
}